<?php
/**
 * Created by PhpStorm.
 * User: 郑好
 * Date: 2019/4/28
 * Time: 上午8:42
 */

namespace app\common;

class Password
{
    use InstanceTrait;

    public function encrypt($plainText)
    {
        return password_hash(
            $plainText,
            PASSWORD_BCRYPT,
            [
                'cost' => 12,
            ]
        );
    }

    public function verify($plaintext, $cipherText)
    {
        return password_verify($plaintext, $cipherText);
    }
}
